package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ZcVehiclesMapper;
import com.ruoyi.system.domain.ZcVehicles;
import com.ruoyi.system.service.IZcVehiclesService;
import com.ruoyi.common.core.text.Convert;

/**
 * 租车车辆Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-03
 */
@Service
public class ZcVehiclesServiceImpl implements IZcVehiclesService 
{
    @Autowired
    private ZcVehiclesMapper zcVehiclesMapper;

    /**
     * 查询租车车辆
     * 
     * @param vehicleId 租车车辆主键
     * @return 租车车辆
     */
    @Override
    public ZcVehicles selectZcVehiclesByVehicleId(Long vehicleId)
    {
        return zcVehiclesMapper.selectZcVehiclesByVehicleId(vehicleId);
    }

    /**
     * 查询租车车辆列表
     * 
     * @param zcVehicles 租车车辆
     * @return 租车车辆
     */
    @Override
    public List<ZcVehicles> selectZcVehiclesList(ZcVehicles zcVehicles)
    {
        return zcVehiclesMapper.selectZcVehiclesList(zcVehicles);
    }

    /**
     * 新增租车车辆
     * 
     * @param zcVehicles 租车车辆
     * @return 结果
     */
    @Override
    public int insertZcVehicles(ZcVehicles zcVehicles)
    {
        zcVehicles.setCreateTime(DateUtils.getNowDate());
        return zcVehiclesMapper.insertZcVehicles(zcVehicles);
    }

    /**
     * 修改租车车辆
     * 
     * @param zcVehicles 租车车辆
     * @return 结果
     */
    @Override
    public int updateZcVehicles(ZcVehicles zcVehicles)
    {
        return zcVehiclesMapper.updateZcVehicles(zcVehicles);
    }

    /**
     * 批量删除租车车辆
     * 
     * @param vehicleIds 需要删除的租车车辆主键
     * @return 结果
     */
    @Override
    public int deleteZcVehiclesByVehicleIds(String vehicleIds)
    {
        return zcVehiclesMapper.deleteZcVehiclesByVehicleIds(Convert.toStrArray(vehicleIds));
    }

    /**
     * 删除租车车辆信息
     * 
     * @param vehicleId 租车车辆主键
     * @return 结果
     */
    @Override
    public int deleteZcVehiclesByVehicleId(Long vehicleId)
    {
        return zcVehiclesMapper.deleteZcVehiclesByVehicleId(vehicleId);
    }
}
